package com.wrupple.muba.catalogs.server.service.impl;

import com.google.inject.Inject;
import com.google.inject.Provider;
import com.wrupple.muba.catalogs.client.activity.CatalogActivity;
import com.wrupple.muba.catalogs.server.integration.handlers.CreationCatalogRequestHandler;
import com.wrupple.muba.catalogs.server.integration.handlers.DeletingCatalogRequestHandler;
import com.wrupple.muba.catalogs.server.integration.handlers.ReadingRequestHandler;
import com.wrupple.muba.catalogs.server.integration.handlers.UpdatingCatalogRequestHandler;
import com.wrupple.muba.catalogs.server.service.CatalogActionTokenMapper;
import com.wrupple.vegetate.server.domain.UnmutableModuleMap;

public class SimpleCatalogActionTokenMapper extends UnmutableModuleMap
		implements CatalogActionTokenMapper {
	private static final long serialVersionUID = 8894048685085203394L;

	@Inject
	public SimpleCatalogActionTokenMapper(
			Provider<ReadingRequestHandler> summary,
			Provider<CreationCatalogRequestHandler> create,
			Provider<ReadingRequestHandler> read,
			Provider<UpdatingCatalogRequestHandler> update,
			Provider<DeletingCatalogRequestHandler> delete) {
		super();
		if (summary != null) {
			super.put(CatalogActivity.SUMMARY_ACTION, summary);
		}
		if (create != null) {
			super.put(CatalogActivity.CREATE_ACTION, create);
		}
		if (read != null) {
			super.put(CatalogActivity.READ_ACTION, read);
		}
		if (update != null) {
			super.put(CatalogActivity.UPDATE_ACTION, update);
		}
		if (delete != null) {
			super.put(CatalogActivity.DELETE_ACTION, delete);
		}
	}

}
